package Stream;

import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Stream;

public class StreamDemo2 {
    public static void main(String[] args) {
        Map<String, Integer>map=new LinkedHashMap<>();
        map.put("Alice", 25);
        map.put("Bob", 30);
        map.put("Charlie", 35);
        map.put("David", 40);

        Stream<String>s1=map.keySet().stream();
//        Stream<String> s5 = s1;
        s1.forEach(System.out::println);
        Stream<Integer>s2=map.values().stream();
        Stream<Map.Entry<String,Integer>>s3=map.entrySet().stream();
        
        String[]names={"Alice","Bob","Charlie","David"};
        Stream<String>s4= Arrays.stream(names);
    }
}
